﻿using System;
using System.Web;
using System.Web.Mvc;
using System.Web.UI.WebControls;
using System.Web.UI;

namespace jquerymvc.Views.Layouts
{
    public partial class Ajax : System.Web.Mvc.ViewMasterPage
    {
        protected ContentPlaceHolder maincontent;
        protected ContentPlaceHolder dynamiccontent;
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            maincontent.Visible = (this.Request["fullpage"] == "true");
        }

        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            if (maincontent.Visible)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Id, "maincontent");
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
            }
            base.Render(writer);
            if (maincontent.Visible)
            {
                writer.RenderEndTag();
            }
        }
    }
}
